package com.林子祺.CAT旅游系统.controller.login;

import com.林子祺.CAT旅游系统.dao.login.RegisterAccount;
import com.林子祺.CAT旅游系统.entity.login.LoginStatus;
import com.林子祺.CAT旅游系统.entity.login.RegisterStatus;
import com.林子祺.CAT旅游系统.view.Menu;
import com.林子祺.CAT旅游系统.view.login.RegisterFailed;

import java.awt.*;

public class RegAccount {

    public static void reg(String name, String password){
        RegisterAccount.addAccount(LoginStatus.nameConfirm, LoginStatus.passwordConfirm);
        if( RegisterStatus.reg == false){
            RegisterFailed.regFail();
        }
        else {
            RegisterStatus.reg = false;
            try {
                Menu.menu();
            } catch (AWTException e) {
                e.printStackTrace();
            }
        }
    }

}
